package behavioral.interpreter;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: Context
 * @Description: 上下文
 * @Author: liu-hao
 * @Date: 2023-04-12 10:26
 * @Version: 1.0
 **/
public class Context {

    private Map<String, Integer> variableMap = new HashMap<>();

    public void assign(String variable, int value) {
        variableMap.put(variable, value);
    }

    public int getValue(String variable) {
        return variableMap.get(variable);
    }
}
